<?php
class Syspxserch_ctl extends Ctl{
    function __construct(){
    }
    function main(array $xxfget) {
        $this::sessver();
        $type=!empty($_POST['type'])?$_POST['type']:false;
        if(!$type){
            $puid=$xxfget['puid'];
        	$result=xdb::getInstance()->getrow('select *  from peixunban as b,peixunxueyuan as x where b.id=x.pid and x.id='.$puid);
        	$this::show('syspxserch',compact('result'));
        }elseif ($type=="add"){
        	$array=array();
        	$array2=array();
        	$realname=$_POST['realname'];
        	$mphone=$_POST['mphone'];
        	$zuoji=$_POST['zuoji'];
        	$zhiwu=$_POST['zhiwu'];
        	$array['realname']=$realname;
        	$array['mphone']=$mphone;
        	$array['username']=$mphone;
        	$array['password']=$mphone;
        	$array['zuoji']=$zuoji;
        	$array['zhiwu']=$zhiwu;
        	$array2['mphone']=$mphone;
        	echo xdb::getInstance()->indb('user', $array, $array2);
        }elseif ($type=="del"){
        	$array=array();
        	$id=$_POST['id'];
        	$array['id']=$id;
        	echo xdb::getInstance()->deldb('user', $array);
        }
    }
}